//
//  Parson.m
//  sss
//
//  Created by 周杨 on 14/11/1.
//  Copyright (c) 2014年 zhouy. All rights reserved.
//

#import "Parson.h"
#import "SelAction.h"
#import "Parson+AgePrint.h"


@implementation Parson

-(void) TestFun:(NSString *) str{

    NSLog(@" TestFun !"); 
}

-(void) FunQueue:(NSMutableArray *) funArry{
    
    
    //@selector(selector)
//    
//    for( SEL * selFun in funArry) {
//        
//    
//    }
}

-(void) SelFun:(SEL) sel , ...  {
    
    va_list args;
    va_start(args, sel);
    
    SEL obj=sel;
    
    do{
        #pragma clang diagnostic push
        #pragma clang diagnostic ignored "-Warc-performSelector-leaks"
        [self performSelector:obj withObject:@"ppp"];
        //            [self performSelector:[ obj getMySel];
        #pragma clang diagnostic pop
        obj=va_arg(args,SEL);//取得下一个指针
        if((sel_getName(obj)=='\0')){
            break;
        }
    }
    while (true);
    
    va_end(args);
}


-(void) Actions:(SelAction *) action , ... {
    if (action) {
        va_list args;
        va_start(args,action);
        
        SelAction * obj=action;
        
        do{
            #pragma clang diagnostic push
            #pragma clang diagnostic ignored "-Warc-performSelector-leaks"
            [self performSelector:[obj getMySel] withObject:@"ppp"];
            
//            [self performSelector:[ obj getMySel];
            #pragma clang diagnostic pop
            
            
            obj=va_arg(args,SelAction *);//取得下一个指针
            
            
            if([[obj Name] isEqual:nil]){
                break;
            }
        }
        while (true);
        va_end(args);
    }
}

@end
